<?php
/**
 * Created by PhpStorm.
 * User: Dominik
 * Date: 3/26/14
 * Time: 8:35 PM
 */
session_start();

if($_SESSION["logged"]){

    include "sqlManager.php";
    $sqlManager = new sqlManager();

    $userID = $sqlManager->getID($_SESSION["username"]);
    $result = $sqlManager->getOwnBMI($userID);

    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta name="zajimaveeeeeee" content="Komodo Edit 8.5">
        <link rel="stylesheet" type="text/css" href="style.css">
        <title>BITWA - Fiala Dominik</title>

    </head>
    <body>
    <div id="hlavicka">
        <h1 align="center">BITWA</h1><br>
        <p>
            <?
            echo $_SESSION[name]." (".$_SESSION[username].")". " <a href=\"prihlaseni.php\">Odhlasit</a>";
            ?>
        </p>
    </div>
    <div id="menu">
        <? include "menu.php" ?>
    </div>
    <div id="obsah">
            <table>
                <tr>
                    <td> Vyska </td>
                    <td> Vaha </td>
                    <td> BMI </td>
                </tr>
        <?
            while($row = mysql_fetch_assoc($result)){
                echo "<tr><td>".$row['height']."</td>
			        <td>".$row['weight']."</td>
			        <td>".$row['bmi']."</td></tr>";
            }
        ?>
            </table>
    </div>
    <div id="copyright">
        &copy fialadom
    </div>
    </body>
    </html>
<?
}else{
    ?>
    <meta http-equiv="refresh" content="0;url=http://databaze.fbmi.cvut.cz/fialadom/BITWA/CV5/prihlaseni.php">
<?php
}
?>


?>